import axios from 'axios'
import { Loading } from 'element-ui'
const request = axios.create({
  baseURL: 'http://127.0.0.1:8888/api/private/v1/',
  timeout: 2000,
  headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
})
request.interceptors.request.use(config => {
  Loading.service({ text: '正在发送请求', background: 'rgba(0, 0, 0, 0.3)' })
  return config
}, err => {
  return Promise.reject(err)
})
request.interceptors.response.use(result => {
  return result
}, err => {
  return Promise.reject(err)
})
export default request